<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content") != null ? request
			.getParameter("content") : "";
%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>添加优惠劵</title>
		<link rel="stylesheet" type="text/css" href="css/index.css" />
		<style>
form {
	margin: 0;
}

textarea {
	display: block;
}
</style>
		<link rel="stylesheet" type="text/css" href="css/index.css" />
		<link rel="stylesheet" href="themes/default/default.css"
			type="text/css" />
		<script charset="utf-8" src="js/jquery.js"></script>
		<script src="js/kindeditor.js"></script>
		<script charset="utf-8" src="js/zh_CN.js"></script>
		<script type="text/javascript">
		KindEditor.ready(function(K) {
			
				var editor = K.editor({
					allowFileManager : true,
					uploadJson : 'upload.action',
					fileManagerJson : 'jsp/file_manager_json.jsp'
				});
				var editor1 = K.create('textarea[name="dis.disSpecialTips"]', {
				cssPath : 'js/plugins/code/prettify.css',
				items : [
						 'bold', 'italic', 'underline',
						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright']
				});
				K('#image3').click(function() {
					editor.loadPlugin('image', function() {
						editor.plugin.imageDialog({
							showRemote : false,
							imageUrl : K('#url3').val(),
							clickFn : function(url, title, width, height, border, align) {
								K('#url3').val(url);
								editor.hideDialog();
								$("#imgs").attr("src",url);
							}
						});
					});
				});
				
				K('#image4').click(function() {
					editor.loadPlugin('image', function() {
						editor.plugin.imageDialog({
							showRemote : false,
							imageUrl : K('#url3').val(),
							clickFn : function(url, title, width, height, border, align) {
								K('#url2').val(url);
								editor.hideDialog();
								$("#imgs2").attr("src",url);
							}
						});
					});
				});
			});
</script>

	</head>
	<body style="overflow-y: auto;">
		<input type="hidden" value="<%=htmlData%>">
		<form action="doDis!savDis.action" method="post">
			<table class="form-table" cellspacing="0" cellpadding="0">
				<colgroup>
					<col style="width: 17%" />
					<col style="width: 83%" />
				</colgroup>
				<tr>
					<td class="bt-xx" colspan="2">
						<img src="images/titlebar_icon.gif" />
						&nbsp;添加优惠劵
					</td>
				</tr>
				<tr>
					<td colspan="2"></td>
				</tr>
				<tr>
					<th>
						商家ID：
					</th>
					<td>
						<input type="text" class="inputstyle" name="dis.disId" />
					</td>
				</tr>
				<tr>
					<th>
						优惠劵名称：
					</th>
					<td>
						<input type="text" class="inputstyle" name="dis.disTitle" />
					</td>
				</tr>
				<tr>
					<th>
						折扣详情： 
					</th>
					<td>
						<input type="text" class="inputstyle" name="dis.disConsume" />
					</td>
				</tr>
				<tr>
					<th>
						价格： 
					</th>
					<td>
						<input type="text" class="inputstyle" name="dis.disPrice" />
					</td>
				</tr>
				<tr>
					<th>
						上传优惠劵小图：
					</th>
					<td>
						<input type="hidden" id="url2" value="" name="dis.disImage" />
						<img id="imgs2" src="images/img.png"
							style="border: 1px solid #ccc; padding: 2px; width: 80px; height: 80px;" />
						&nbsp;
						<input type="button" id="image4" value="本地上传" />
					</td>
				</tr>
				<tr>
					<th>
						上传优惠劵(一张)：
					</th>
					<td>
						<input type="hidden" id="url3" value="" name="dis.disImageContent" />
						<img id="imgs" src="images/img.png"
							style="border: 1px solid #ccc; padding: 2px; width: 250px; height: 250px;" />
						&nbsp;
						<input type="button" id="image3" value="本地上传" />
					</td>
				</tr>

				<tr>
					<th>
						特别提示：
					</th>
					<td>
						<textarea cols="100" rows="8"
							style="width: 700px; height: 100px; visibility: hidden;"
							name="dis.disSpecialTips"></textarea>
					</td>
				</tr>
				<tr>
					<th>
						有效时间：
					</th>
					<td>
						<input type="text" class="inputstyle" name="dis.disTime" />
					</td>
				</tr>
				<tr>
					<th>
						地址：
					</th>
					<td>
						<input type="text" class="inputstyle" name="dis.disAddress" />
					</td>
				</tr>
				<tr>
					<th>
						下载次数： 
					</th>
					<td>
						<input type="text" class="inputstyle" name="dis.disCount" />
					</td>
				</tr>
				<tr>
					<th></th>
					<td>
						<input type="submit" class="buttonstyle" value="保存" />
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>